<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>canvas</title>
</head>
<body>
<canvas id="myCanvas" width="200" height="100"></canvas>
</body>
<script type="text/javascript">
    var c=document.getElementById("myCanvas"); // 1. 获取canvas dom节点引用
    var cxt=c.getContext("2d");                // 2. 创建上下文（context）环境
    /*cxt.fillStyle="#FF0000";                   // 3. 开始绘图
    cxt.fillRect(0,0,150,75);*/

    cxt.strokeStyle="#FF0000";
    cxt.strokeRect(0,0,150,75);
</script>
</html>